package com.liaozl.sca.user.controller;

import com.liaozl.sca.common.dto.Result;
import com.liaozl.sca.user.dto.UserDTO;
import com.liaozl.sca.user.feign.UserFeign;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description:
 * @version: v1.0.0
 * @author: liaozuliang
 * @date: 2021/9/17 18:30
 */
@Slf4j
@RestController
public class UserController implements UserFeign {

    @Override
    public Result<Boolean> insert(@RequestBody UserDTO userDTO) {
        log.info("=====insert=====");
        return Result.success(true);
    }

    @Override
    public Result<Boolean> delete(@RequestParam("userId") Long userId) {
        log.info("=====delete=====");
        return Result.success(true);
    }

    @Override
    public Result<Boolean> update(@RequestBody UserDTO userDTO) {
        log.info("=====update=====");
        return Result.success(true);

    }

    @Override
    public Result<UserDTO> getByUserId(@PathVariable("userId") Long userId) {
        log.info("=====getByOrderNo=====");
        UserDTO userDTO = new UserDTO();
        userDTO.setId(userId);
        return Result.success(userDTO);
    }
}
